package com.tintuc24h.adapter;

import com.tintuc24h.com.R;
import com.tintuc24h.untils.Variables;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class PaperAdapter extends ArrayAdapter<String>{
	
	
	private Context context;
	private String[] paper;
	
	public PaperAdapter(Context context, int textViewResourceId,
			String[] paper) {
		super(context, textViewResourceId, paper);
		
		this.context=context;
		this.paper=paper;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View viewrow= inflater.inflate(R.layout.theloai, parent, false);
		ImageView iv=(ImageView) viewrow.findViewById(R.id.ivicon);
		TextView tv=(TextView) viewrow.findViewById(R.id.tvtintuc);
		iv.setImageResource(Variables.ICONS[position]);
		tv.setText(paper[position]);
		
		return viewrow;
	}
	

	

}
